#!/bin/bash

sh='rsync-builder'
ori_sh=$PWD/$sh
dect_sh=/usr/local/bin/$sh

cat > $sh << EOF
#!/bin/bash

$PWD/rsync-gen.py "\$@"
EOF

sudo chmod +x $PWD/$sh

if [[ -f "$dect_sh" ]]; then
    sudo rm -f $dect_sh
fi

sudo ln -s $ori_sh $dect_sh